package day01.BigInteger类;

import java.math.BigInteger;

/**
 * @author feng
 * @Date 2022/1/4 10:20
 * 大数：整数的操作
 */
public class Test1 {
    public static void main(String[] args) {
        BigInteger bigInteger1 = new BigInteger("987654321");
        BigInteger bigInteger2 = new BigInteger("123456789");
        System.out.println("加法操作:" + bigInteger1.add(bigInteger2));
        System.out.println("剑法操作: " + bigInteger1.subtract(bigInteger2));
        System.out.println("惩罚操作" + bigInteger1.multiply(bigInteger2));
        BigInteger[] big = bigInteger1.divideAndRemainder(bigInteger2); //求余除法
        System.out.println("商:" + big[0] + "余数:" + big[1]);

    }
}
